From 057f209c5611844059fb9ed52543e9f9f2b023aa Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 3 Jun 2006 15:04:49 +0000 Subject: [PATCH] [DOS_NT] : Include fcntl.h and io.h. (main) [DOS_NT]: Switch stdin to binary mode, if it is not a terminal device. --- lib-src/digest-doc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib-src/digest-doc.c b/lib-src/digest-doc.c index 7b5a9677e7c..7787d422e39 100644 --- a/lib-src/digest-doc.c +++ b/lib-src/digest-doc.c @@ -26,12 +26,23 @@ #include +#ifdef DOS_NT +#include /* for O_BINARY */ +#include /* for setmode */ +#endif + int main () { register int ch; register int notfirst = 0; +#ifdef DOS_NT + /* DOC is a binary file. */ + if (!isatty (fileno (stdin))) + setmode (fileno (stdin), O_BINARY); +#endif + printf (".TL\n"); printf ("Command Summary for GNU Emacs\n"); printf (".AU\nRichard M. Stallman\n"); -- 2.30.2